<?php 
	session_start();
	include 'connect.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<link rel="stylesheet" type="text/css" href="styles.css"/>
</head>
<body>
<div class="logo"></div> 
<div id="container">
<div id="MainContent">
<div id="user">
<?php
			
			if (isset($_SESSION['MemberID'])){
					echo "Hi, ".$_SESSION['Username'].".<br />";
				}
				?>

<?php if (isset($_SESSION['MemberID'])){ echo "<a href='logout.php'>Logout</a>";}?>
</div>
<div class="clear"></div>

<div class="linksContainer">
<?php 

//print_r($_SESSION['MemberID']);
if(isset($_SESSION['MemberID'])){
	echo "<a href='welcome.php'  class='links'>Home Page</a>";
	echo "<a href='memberProfile.php' class='links'>My Profile</a>";
	echo "<a href='memberProjects.php' class='links'>My Projects</a>";
	echo "<a href='projMan.php' class='links'>View Current Projects</a>";
	echo "<a href='createProject.php' class='links'>Create a Project</a>";

			}
			else echo "Please <a href='index.php'>login</a> to access this page.";
			

?>
</div><!--linksContainer-->
<?php 
				//print_r($_SESSION);
				if (isset($_SESSION['MemberID'])){
					$ProjectName = mysql_real_escape_string($_POST["Project_Name"]);
					$Description = mysql_real_escape_string($_POST["Description"]);
					$Status = mysql_real_escape_string($_POST["Status"]);
					$MemberID = $_SESSION['MemberID'];
					$ProjectID = $_POST['Project_Name'];	
					
					
						$sql="INSERT INTO project (ProjectName, Status, Description, CreatorID) 
						Values ('$ProjectName', '$Status', '$Description', '$MemberID' )";
					
					if (!mysql_query($sql,$connection))
					  {
					  die('Error: ' . mysql_error() . 'in query '.$sql);
					  }
					mysql_close($connection);
				}
				else echo "Please <a href='index.php'>login</a> to access this page.";
				
				echo "<p>Thank you for creating a new project...<br /><br />";
				echo "Name:".$ProjectName."<br />";
				echo "Status:".$Status."<br />";
				echo "Description:".$Description."<br />";
				?>
</div>
</div>
</body>
</html>